package com.lagou.common.feign;

import com.lagou.common.pojo.Goods;
import com.lagou.common.pojo.ResponseResult;
import org.springframework.stereotype.Component;

/**
 * @BelongProject: SpringCloudDemo
 * @author: 胡恺恺
 * @createTime: 2021/1/27  11:52
 * @Description:
 */
@Component
public class GoodsFeignFallBack implements GoodsFeign {

    /**
     * 通过id查询商品列表
     * @param id
     * @return
     */
    @Override
    public ResponseResult queryById(Integer id) {
        Goods goods = new Goods();
        goods.setId(id);
        goods.setName("服务降级");
        goods.setFlag("1");
        goods.setGoodsDesc("默认商品");
        goods.setPrice(0);
        goods.setGoodsStock(0);
        goods.setImages("服务降级");
        goods.setGoodsType("默认分类");
        return new ResponseResult(true,200,"服务熔断后降级",goods);
    }
}
